#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e6 + 10;
using ll = long long;
pair<int, int> a[N];
int main()
{
    int n;
    cin >> n;
    ll sum = 0, wait = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i].first;
        a[i].second = i;
    }
    sort(a + 1, a + 1 + n);
    for (int i = 1; i <= n; i++)
    {
        sum += a[i - 1].first;
        wait += sum;
        cout << a[i].second << " ";
        int x;
    }
    cout << endl;
    printf("%.2lf", (double)wait / n);

    for (int i = 1; i <= n; i++) 
    {
        cout << endl; 
    }
    return 0;
}